<%@ page language="java" pageEncoding="utf-8"%>
<%@ taglib uri="/WEB-INF/tlds/c.tld" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>用户组管理</title>
	<link rel="stylesheet" type="text/css" href="../css/index.css"></link>
	<script src="../js/common.js"></script>
	<script src="../js/jquery.plugins/jquery.js"></script>
	<link rel="stylesheet" type="text/css" href="../js/jquery.plugins/easyui/css/default/easyui.css"></link>
	<link rel="stylesheet" type="text/css" href="../js/jquery.plugins/easyui/css/icon.css"></link>
	<script src="../js/jquery.plugins/easyui/jquery.easyui.min.js"></script>
	<script src="../js/jquery.plugins/easyui/easyui-lang-zh_CN.js"></script>
	<script>
		$(function(){
			$('#saveBtn').linkbutton({iconCls:'icon-save',text:"保存",plain:true});
			$('#backBtn').linkbutton({iconCls:'icon-back',text:"返回上一页",plain:true});
			$('#resetBtn').linkbutton({iconCls:'icon-reload',text:"重置",plain:true});
			
			$("#name").validatebox( {
				required:true,
				validType:"length[3,32]",
				missingMessage:"组名称不能为空",
				invalidMessage:"组名称在3到32个字符以内。"
			});
			$("#memo").validatebox( {
				validType:"length[0,256]",
				invalidMessage:"描述在0到256个字符以内。"
			});
			$("form").submit(function(){
					return checkValidate(['name','memo']);
				}	
			);
		});
		function checkSame(){
			if( $.trim( $("#name").val() ) == "" ){
				$.messager.alert( '提示','还没有填写名称!','info');
				return;
			}
			var param = "name=" + $.trim( $("#name").val() ) + "&id=" + $("#id").val();
			jsonSend("check.ht",param,function(data){
				if( data.has )
					errorMsg( "提示","该名称重复" );
				else
					infoMsg( "提示","该名称不重复" );
			});
		}
	</script>
</head>
<body>
	<!-- 导航部分 -->
	<div class="position">
	您当前的位置：系统管理 &gt;&gt; <a href="list.ht">用户组管理</a> &gt;&gt; 编辑用户组信息
	</div>
	<!-- 导航部分结束 -->
	<!-- 表单部分开始 -->
	<div>
		<form action="save.ht" method="post">
			<input type="hidden" name="id" id="id" value="${model.id}"/>
			<table class="form" style="width:610px;">
				<tr>
					<td class="title">组名称：</td>
					<td><input type="text" style="width:400px;"  id="name" name="name" value="${model.name }"/>
					<a href="#" onclick="checkSame();">检查组名称是否重复</a></td>
				</tr>
				<tr>
					<td class="title">简介：</td>
					<td><textarea id="memo" name="memo">${model.memo }</textarea></td>
				</tr>
				<tr>
					<td colspan="2" class="btntd">
					<a href="javascript:commit();" id="saveBtn">保存</a>
					<a href="javascript:reset();" id="resetBtn">重置</a>
					<a href="javascript:goBack();" id="backBtn">返回上一页</a>
					</td>
				</tr>
			</table>
		</form>
	</div>
	<!-- 表单部分结束  -->
</body>
</html>